package com.yogi.webframework.service;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.yogi.webframework.dao.ShopDao;
import com.yogi.webframework.model.Shop;

@Service("shopService")
@Transactional( propagation = Propagation.MANDATORY )
public class ShopServiceImpl implements ShopService {

	@Autowired ShopDao shopDao;
	
//	@Transactional(readOnly=false, propagation=Propagation.REQUIRES_NEW)
	public void delete(Shop domain) {
		shopDao.delete(domain);
	}

	public List<Shop> findAll() {
		return shopDao.findAll();
	}

	public Shop findById(Serializable id) {
		return shopDao.findById(id);
	}

//	@Transactional(readOnly=false, propagation=Propagation.REQUIRES_NEW)
	public void save(Shop domain) {
		shopDao.save(domain);
	}

}
